
import 'package:find_friend/pages/im/custompage/msg_raiselist.dart';
import 'package:find_friend/pages/im/custompage/msg_report_page.dart';
import 'package:find_friend/pages/login&register/login.dart';
import 'package:find_friend/pages/login&register/login_age&sex.dart';
import 'package:find_friend/pages/login&register/login_forgetpwd.dart';
import 'package:find_friend/pages/login&register/login_username.dart';
import 'package:find_friend/pages/mine/certifacation/mine_cerrifacation.dart';
import 'package:find_friend/pages/mine/mine_blackspace.dart';
import 'package:find_friend/pages/mine/mine_follow.dart';
import 'package:find_friend/pages/mine/mine_message.dart';
import 'package:find_friend/pages/mine/mine_mod/mine_modname.dart';
import 'package:find_friend/pages/mine/mine_preview_page.dart';
import 'package:find_friend/pages/mine/mine_setting/mine_setting.dart';
import 'package:find_friend/pages/mine/mine_setting/mine_setting_account.dart';
import 'package:find_friend/pages/mine/mine_setting/setting_about.dart';
import 'package:find_friend/pages/mine/mine_setting/setting_blacklist.dart';
import 'package:find_friend/pages/mine/mine_setting/setting_notifier.dart';
import 'package:find_friend/pages/mine/mine_sign.dart';
import 'package:find_friend/pages/search/search_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import 'pages/im/custompage/msg_receive_commentpage.dart';
import 'pages/im/custompage/msg_scenes.dart';
import 'pages/im/pages/conversation_page.dart';
import 'pages/im/pages/file_preview_page.dart';
import 'pages/im/pages/image_preview_page.dart';
import 'pages/im/pages/sight/video_play_page.dart';
import 'pages/im/pages/sight/video_record_page.dart';
import 'pages/im/pages/webview_page.dart';
import 'pages/mine/mine_mod/mine_modavatar.dart';
import 'pages/mine/mine_mod/mine_modsign.dart';
import 'pages/mine/mine_setting/setting_mod_phone.dart';
import 'pages/mine/mine_setting/setting_mod_pwd.dart';
import 'pages/xspace/detail/xdetailpage.dart';
import 'pages/xspace/detail/xdiscussdetail.dart';
import 'pages/xspace/post/xpost_editimg_page.dart';

final routes = {
  '/': (context) => LoginScreen(),
  '/conversation': (context, {arguments}) =>
      ConversationPage(arguments: arguments),
  '/image_preview': (context, {arguments}) =>
      ImagePreviewPage(message: arguments),
  '/video_record': (context, {arguments}) =>
      VideoRecordPage(arguments: arguments),
  '/video_play': (context, {arguments}) => VideoPlayPage(message: arguments),
  '/file_preview': (context, {arguments}) =>
      FilePreviewPage(message: arguments),
  '/webview': (context, {arguments}) => WebViewPage(url: arguments),
  '/msgreceivecomment':(context, {arguments}) => MsgReceiveComment(), // 消息列表
  '/msgraise':(context, {arguments}) => MsgRaisePage(), // 消息列表
  '/msgscenes':(context, {arguments}) => MsgScenesPage(mobile: arguments,), // 消息列表
  


  /// 登录
  '/forget':(context, {arguments}) => ForgetPasswordPage(phone: arguments),
  '/username':(context,{arguments}) => LoginModUserNamePage(),
  '/userAgeSex':(context, {arguments}) => LoginAgeAndSexPage(),//
  '/minecertifacation':(context, {arguments}) => MineCertifacationPage(),//

  /// 个人中心
  '/userfollow':(context, {arguments}) => MineFollowPage(),// 我的星域
  '/usermessage':(context, {arguments}) => MineMessage(), // 弹幕管理
  '/userblack':(context, {arguments}) => MineBlackSpacePage(), // 黑匣子
  '/usersetting':(context, {arguments}) => MineSettingPage(), // 系统设置
  '/settingaccount':(context, {arguments}) => MineSettingAccountPage(), // 修改手机号
  '/settingmodphone':(context, {arguments}) => MineSettingModPhonePage(), // 系统设置修改手机号码绑定
  '/settingmodpwd':(context, {arguments}) => MineSettingModPwdPage(), // 系统设置修改密码
  '/settingnotifier':(context, {arguments}) => SettingNotifierPage(),// 设置系统通知
  '/settingblacklist':(context, {arguments}) => SettingBlacklistPage(),// 黑名单列表
  '/settingabout':(context, {arguments}) => SettingAboutPage(),// 关于我们
  '/minemodname':(context, {arguments}) => MineModNamePage(),
  '/minemodavatar':(context, {arguments}) => MineModAvatarPage(),
  '/minemodsign':(context, {arguments}) => MineModSignPage(),
  '/minepreview':(context, {arguments}) => MinePreviewPage(mobile: arguments,), // 我的预览
  '/minesign':(context, {arguments}) => MineSignPage(mobile: arguments,), // 我的预览
  

  /// x区
  '/xdetailpage':(context, {arguments}) => XDetailPage(model: arguments,),
  '/xdiscussdetailpage':(context, {arguments}) => XDiscussDetailPage(model: arguments,),
  
  '/xposteditimg':(context, {arguments}) => XPostEditImgPage(list: arguments,), // 发布动态
  '/msgreport':(context, {arguments}) => MsgReportPage(mobile: arguments,), // 举报
  
  '/search':(context, {arguments}) => SearchPage(), // 消息列表
};

var onGenerateRoute = (RouteSettings settings) {
  // 统一处理
  final String name = settings.name;
  final Function pageContentBuilder = routes[name];
  if (pageContentBuilder != null) {
    if (settings.arguments != null) {
      final Route route = CupertinoPageRoute(
          builder: (context) =>
              pageContentBuilder(context, arguments: settings.arguments));
      return route;
    } else {
      final Route route =
          CupertinoPageRoute(builder: (context) => pageContentBuilder(context));
      return route;
    }
  }
};
